package com.rest.demo.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * @author Administrator
 * @decription
 * @Date 2018-02-05 14:03
 */
public class OutputStreamDemo {
    public static void main(String[] args) {
        OutputStream os = null;
        try {
            os = new FileOutputStream("F:\\out.txt",true);
            String hello = "\r\nYangBo";
            os.write(hello.getBytes());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                os.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
